<?php

namespace App\Http\Controllers\Api\V1;

use App\Services\MakeGoldChargeOrder\MakeGoldChargeOrder;
use App\Http\Controllers\Api\V1\Resources\GoldChargeResource;
use App\Services\MakeGoldChargeOrder\MakeGoldChargeOrderRequest;

class GoldChargesController extends Controller
{
    public function store(MakeGoldChargeOrderRequest $request): GoldChargeResource
    {
    	$charge = app(MakeGoldChargeOrder::class, [
    		'user' => $request->user(),
		    'amount' => $request->amount]
	    )->make();

    	return new GoldChargeResource($charge);
    }
}
